@extends('host.common.common')
@section('head')

    <link rel="stylesheet" href="/assets/b2b/css/ui-dialog.css">
    <style type="text/css">label.error{margin-left: 18px;color: #FF500B;line-height: 32px}</style>

    <script src="/assets/b2b/js/pageConfig.js"></script>
    <script src="/assets/b2b/js/libs/jquery-1.11.3.min.js"></script>
    <script src="/assets/b2b/js/libs/underscore-min.js"></script>
     @stop

    @section('body')

            <!-- top_test -->
    <div id="top_test"></div>

    <!-- web_logo_search -->
    <div id="web_logo_search"></div>

    <!-- comm_nav -->
    <div id="comm_nav"></div>

    <div class="com-w ">
        <div class="top-navigation">
            <span class="top-bg-img clearfix"></span>
            您当前的位置：
            <a href="{{route('host')}}">首页</a>
            > 采购商申请授权
        </div>
        <div class="clearfix authorization-application bdd">
            <div class="way-title wb100 h40 ">
                <div class="ml10 c-coffee f16 lh40">申请人基本信息</div>
            </div>
            @if(count($errors) > 0)
                @foreach($errors->all() as $error)
                    <p>{{ $error }}</p>
                @endforeach
            @endif
            <form id="basic_information" action="{{route('store.authorization', [$store_id])}}" method="POST" class="clearfix">
                {{csrf_field()}}
                <div class="a-a-main">
                    <div class="aa-list mt10 clearfix">
                        <div class="aa-l-l fl tr wb30">
                            <span class="b002">*</span>
                            公司全称：
                        </div>
                        <div class="aa-l-r fl tl wb22">
                            <input type="text" name="company_name"></div>
                    </div>
                    <div class="aa-list mt10 clearfix">
                        <div class="aa-l-l fl tr wb30">
                            <span class="b002">*</span>
                            联系人：
                        </div>
                        <div class="aa-l-r fl tl wb30">
                            <input type="text" name="contact_name">
                            <span class="aa-sex-radio">
                                <input type="radio" name="sex" value="0">先生</span>
                            <span class="aa-sex-radio ">
                                <input type="radio" name="sex" value="1">女士</span>
                        </div>
                    </div>
                    <div class="aa-list mt10 clearfix">
                        <div class="aa-l-l fl tr wb30">
                            <span class="b002">*</span>
                            联系人电话：
                        </div>
                        <div class="aa-l-r fl tl wb22">
                            <input type="text" name="contact_phone"></div>
                    </div>
                    <div class="aa-list mt10 clearfix">
                        <div class="aa-l-l fl tr wb30">
                            <span class="b002">*</span>
                            电子邮件：
                        </div>
                        <div class="aa-l-r fl tl wb22">
                            <input type="text" name="contact_email"></div>
                    </div>
                    <div class="aa-list mt10 clearfix">
                        <div class="aa-l-l fl tr wb30">
                            <span class="b002">*</span>
                            申请留言：
                        </div>
                        <div class="aa-l-r fl tl wb40">
                            <textarea name="message"></textarea>
                            <div class="c-999 mt15">（请详细填写您需要申请采购的商品型号及其它展示您销售实力等的描述）</div>
                        </div>
                    </div>
                    <div class="h48 bgf9 mt80 aa-bottom">
                        <div class="wb60 c-666 ml15 f14 lh48 fl">提示：填入真实、完整的信息可以提高您申请通过的几率。</div>
                        <div class="fr wb30">
                            <input class="btn btn-important btn-w200x48 fr" value="提交申请" type="submit" ></div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- foot_nav -->
    <div id="foot_nav"></div>
    <div id="bottom_main"></div>
    <script type="text/javascript" src="/assets/b2b/js/libs/jquery.validate.min.js"></script>
    <script src="/assets/b2b/js/libs/messages_zh.js"></script>

    <script src="/assets/b2b/js/libs/page/template-util.js"></script>

    <script type="text/javascript">
        // 主要分类：咖啡豆及咖啡相关,等.

        $(function(){
            commTemplUtil.initPage();
            $("#basic_information").validate({
                rules: {
                    company_name: "required",
                    contact_phone: {
                        required: true,
                        mobileCHINA: true,
                    },
                    contact_email: {
                        required: true,
                        email: true,
                    },
                    message:"required",
                    sex:"required",
                },
                messages: {
                    contact_phone: {
                        required: "请输入手机号码",
                        mobileCHINA: "请输入有效手机号码"
                    },
                    // offer_1: "2-16个字符，不允许填写电话和特殊符号",
                },
                errorPlacement: function(error, element) {
                    if (element.attr("name") == "signflag") {
                        element.parents(".electronic-bottom").append(error);
                    } else {
                        element.parents(".aa-l-r").after($("<div class='key-lbl tc fl '/>").append(error));
                    }
                },

            });
        });

    </script>
@stop

